<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主控制台 - 工业管道安全巡检系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        .sidebar-gradient {
            background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
        }
        .sidebar-item {
            transition: all 0.2s ease;
        }
        .sidebar-item:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateX(4px);
        }
        .sidebar-item.active {
            background: rgba(255, 255, 255, 0.15);
            border-left: 4px solid #fbbf24;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- 顶部导航栏 -->
    <nav class="bg-white shadow-lg border-b border-gray-200 fixed w-full top-0 z-50">
        <div class="px-6 py-4">
            <div class="flex justify-between items-center">
                <div class="flex items-center space-x-4">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gradient-to-br from-blue-600 to-purple-600 rounded-lg flex items-center justify-center">
                            <i class="fas fa-industry text-white text-lg"></i>
                        </div>
                        <div>
                            <h1 class="text-xl font-bold text-gray-800">工业管道安全巡检系统</h1>
                            <p class="text-xs text-gray-500">Industrial Pipeline Safety Inspection System</p>
                        </div>
                    </div>
                    <div class="hidden lg:block h-6 w-px bg-gray-300 ml-6"></div>
                    <div class="hidden lg:flex items-center space-x-2 text-sm text-gray-600">
                        <i class="fas fa-map-marker-alt text-blue-500"></i>
                        <span>石化园区A区管理中心</span>
                    </div>
                </div>
                
                <div class="flex items-center space-x-4">
                    <!-- 搜索框 -->
                    <div class="hidden md:block relative">
                        <input type="text" placeholder="搜索任务、线路、人员..." 
                               class="w-80 pl-10 pr-4 py-2 bg-gray-100 border-0 rounded-lg focus:ring-2 focus:ring-blue-500 focus:bg-white transition">
                        <i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
                    </div>
                    
                    <!-- 通知中心 -->
                    <div class="relative">
                        <button class="p-2 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition relative">
                            <i class="fas fa-bell text-xl"></i>
                            <span class="absolute -top-1 -right-1 w-5 h-5 bg-red-500 text-white text-xs rounded-full flex items-center justify-center">8</span>
                        </button>
                    </div>
                    
                    <!-- 消息中心 -->
                    <button class="p-2 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition">
                        <i class="fas fa-envelope text-xl"></i>
                    </button>
                    
                    <!-- 用户信息 -->
                    <div class="flex items-center space-x-3 pl-4 border-l border-gray-200">
                        <img src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop&crop=face" 
                             alt="用户头像" class="w-10 h-10 rounded-full border-2 border-gray-200">
                        <div class="hidden lg:block">
                            <p class="text-sm font-semibold text-gray-800">张管理员</p>
                            <p class="text-xs text-gray-500">系统管理员</p>
                        </div>
                        <button class="text-gray-400 hover:text-gray-600">
                            <i class="fas fa-chevron-down"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <div class="flex pt-20">
        <!-- 侧边栏 -->
        <aside class="sidebar-gradient w-72 min-h-screen shadow-2xl fixed">
            <div class="p-6">
                <!-- 侧边栏头部 -->
                <div class="text-white mb-8">
                    <div class="flex items-center space-x-3">
                        <div class="w-12 h-12 bg-white bg-opacity-20 rounded-xl flex items-center justify-center">
                            <i class="fas fa-tachometer-alt text-white text-xl"></i>
                        </div>
                        <div>
                            <h2 class="font-bold text-lg">控制台</h2>
                            <p class="text-blue-200 text-sm">管理中心</p>
                        </div>
                    </div>
                </div>
                
                <!-- 导航菜单 -->
                <nav class="space-y-2">
                    <div class="text-blue-200 text-xs font-semibold uppercase tracking-wider mb-4">主要功能</div>
                    
                    <a href="#" class="sidebar-item active flex items-center px-4 py-3 text-white rounded-xl">
                        <i class="fas fa-tachometer-alt w-6 text-lg"></i>
                        <span class="ml-3 font-medium">主控制台</span>
                    </a>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-route w-6 text-lg"></i>
                        <span class="ml-3 font-medium">线路管理</span>
                        <span class="ml-auto bg-blue-500 text-xs px-2 py-1 rounded-full">156</span>
                    </a>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-clipboard-check w-6 text-lg"></i>
                        <span class="ml-3 font-medium">巡检管理</span>
                        <span class="ml-auto bg-green-500 text-xs px-2 py-1 rounded-full">23</span>
                    </a>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-exclamation-triangle w-6 text-lg"></i>
                        <span class="ml-3 font-medium">缺陷管理</span>
                        <span class="ml-auto bg-red-500 text-xs px-2 py-1 rounded-full">8</span>
                    </a>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-tools w-6 text-lg"></i>
                        <span class="ml-3 font-medium">消缺管理</span>
                        <span class="ml-auto bg-yellow-500 text-xs px-2 py-1 rounded-full">12</span>
                    </a>
                    
                    <div class="text-blue-200 text-xs font-semibold uppercase tracking-wider mt-8 mb-4">数据分析</div>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-chart-bar w-6 text-lg"></i>
                        <span class="ml-3 font-medium">统计报表</span>
                    </a>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-chart-line w-6 text-lg"></i>
                        <span class="ml-3 font-medium">数据可视化</span>
                    </a>
                    
                    <div class="text-blue-200 text-xs font-semibold uppercase tracking-wider mt-8 mb-4">系统管理</div>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-users w-6 text-lg"></i>
                        <span class="ml-3 font-medium">用户管理</span>
                    </a>
                    
                    <a href="#" class="sidebar-item flex items-center px-4 py-3 text-blue-100 hover:text-white rounded-xl">
                        <i class="fas fa-cog w-6 text-lg"></i>
                        <span class="ml-3 font-medium">系统设置</span>
                    </a>
                </nav>
            </div>
        </aside>

        <!-- 主内容区 -->
        <main class="flex-1 ml-72 p-8 bg-gray-50">
            <!-- 页面头部 -->
            <div class="mb-8">
                <div class="flex justify-between items-center">
                    <div>
                        <h1 class="text-3xl font-bold text-gray-800 mb-2">主控制台</h1>
                        <p class="text-gray-600">欢迎回来，张管理员。今日是 2025年1月17日，星期五</p>
                    </div>
                    <div class="flex space-x-3">
                        <button class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-xl font-medium shadow-lg hover:shadow-xl transition">
                            <i class="fas fa-plus mr-2"></i>新建任务
                        </button>
                        <button class="bg-white hover:bg-gray-50 text-gray-700 px-6 py-3 rounded-xl font-medium shadow-lg border border-gray-200 transition">
                            <i class="fas fa-download mr-2"></i>导出报表
                        </button>
                    </div>
                </div>
            </div>
            
            <!-- 实时状态信息 -->
            <div class="bg-gradient-to-r from-blue-600 to-purple-600 rounded-2xl p-6 mb-8 text-white">
                <div class="flex items-center justify-between">
                    <div>
                        <h2 class="text-xl font-semibold mb-2">系统实时状态</h2>
                        <p class="text-blue-100">所有系统运行正常，数据同步正常</p>
                    </div>
                    <div class="flex items-center space-x-6">
                        <div class="text-center">
                            <div class="w-12 h-12 bg-white bg-opacity-20 rounded-full flex items-center justify-center mb-2">
                                <i class="fas fa-server text-xl"></i>
                            </div>
                            <div class="text-sm text-blue-100">系统状态</div>
                            <div class="text-lg font-bold">正常</div>
                        </div>
                        <div class="text-center">
                            <div class="w-12 h-12 bg-white bg-opacity-20 rounded-full flex items-center justify-center mb-2">
                                <i class="fas fa-users text-xl"></i>
                            </div>
                            <div class="text-sm text-blue-100">在线用户</div>
                            <div class="text-lg font-bold">24</div>
                        </div>
                        <div class="text-center">
                            <div class="w-12 h-12 bg-white bg-opacity-20 rounded-full flex items-center justify-center mb-2">
                                <i class="fas fa-clock text-xl"></i>
                            </div>
                            <div class="text-sm text-blue-100">最后更新</div>
                            <div class="text-lg font-bold">1分钟前</div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 数据概览卡片 -->
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
                <div class="bg-white p-6 rounded-2xl shadow-lg card-hover border border-gray-100">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-500 text-sm font-medium">管道线路</p>
                            <p class="text-3xl font-bold text-gray-800 mt-2">156</p>
                            <div class="flex items-center mt-2">
                                <span class="text-green-600 text-sm font-semibold">↑ 8.2%</span>
                                <span class="text-gray-500 text-sm ml-2">较上月</span>
                            </div>
                        </div>
                        <div class="w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-600 rounded-2xl flex items-center justify-center">
                            <i class="fas fa-route text-white text-2xl"></i>
                        </div>
                    </div>
                </div>

                <div class="bg-white p-6 rounded-2xl shadow-lg card-hover border border-gray-100">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-500 text-sm font-medium">今日巡检</p>
                            <p class="text-3xl font-bold text-gray-800 mt-2">23</p>
                            <div class="flex items-center mt-2">
                                <span class="text-green-600 text-sm font-semibold">↑ 12.5%</span>
                                <span class="text-gray-500 text-sm ml-2">较昨日</span>
                            </div>
                        </div>
                        <div class="w-16 h-16 bg-gradient-to-br from-green-500 to-green-600 rounded-2xl flex items-center justify-center">
                            <i class="fas fa-clipboard-check text-white text-2xl"></i>
                        </div>
                    </div>
                </div>

                <div class="bg-white p-6 rounded-2xl shadow-lg card-hover border border-gray-100">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-500 text-sm font-medium">待处理缺陷</p>
                            <p class="text-3xl font-bold text-gray-800 mt-2">8</p>
                            <div class="flex items-center mt-2">
                                <span class="text-red-600 text-sm font-semibold">↑ 3</span>
                                <span class="text-gray-500 text-sm ml-2">新增</span>
                            </div>
                        </div>
                        <div class="w-16 h-16 bg-gradient-to-br from-red-500 to-red-600 rounded-2xl flex items-center justify-center">
                            <i class="fas fa-exclamation-triangle text-white text-2xl"></i>
                        </div>
                    </div>
                </div>

                <div class="bg-white p-6 rounded-2xl shadow-lg card-hover border border-gray-100">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-500 text-sm font-medium">完成率</p>
                            <p class="text-3xl font-bold text-gray-800 mt-2">94.2%</p>
                            <div class="flex items-center mt-2">
                                <span class="text-green-600 text-sm font-semibold">↑ 2.1%</span>
                                <span class="text-gray-500 text-sm ml-2">较上月</span>
                            </div>
                        </div>
                        <div class="w-16 h-16 bg-gradient-to-br from-purple-500 to-purple-600 rounded-2xl flex items-center justify-center">
                            <i class="fas fa-percentage text-white text-2xl"></i>
                        </div>
                    </div>
                </div>
            </div></p>
                        </div>
                    </div>
                </div>

                <div class="bg-white p-6 rounded-lg shadow">
                    <div class="flex items-center">
                        <div class="p-3 bg-yellow-100 rounded-lg">
                            <i class="fas fa-tools text-yellow-600 text-xl"></i>
                        </div>
                        <div class="ml-4">
                            <p class="text-gray-500 text-sm">消缺任务</p>
                            <p class="text-2xl font-bold text-gray-800">12</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
                <!-- 巡检进度图表 -->
                <div class="bg-white p-6 rounded-lg shadow">
                    <h3 class="text-lg font-semibold mb-4">本月巡检进度</h3>
                    <canvas id="inspectionChart" height="200"></canvas>
                </div>

                <!-- 缺陷分布图表 -->
                <div class="bg-white p-6 rounded-lg shadow">
                    <h3 class="text-lg font-semibold mb-4">缺陷等级分布</h3>
                    <canvas id="defectChart" height="200"></canvas>
                </div>

                <!-- 最新动态 -->
                <div class="bg-white p-6 rounded-lg shadow">
                    <h3 class="text-lg font-semibold mb-4">最新动态</h3>
                    <div class="space-y-4">
                        <div class="flex items-start space-x-3">
                            <div class="w-2 h-2 bg-blue-500 rounded-full mt-2"></div>
                            <div>
                                <p class="text-sm text-gray-800">线路A-001完成巡检</p>
                                <p class="text-xs text-gray-500">2分钟前</p>
                            </div>
                        </div>
                        <div class="flex items-start space-x-3">
                            <div class="w-2 h-2 bg-red-500 rounded-full mt-2"></div>
                            <div>
                                <p class="text-sm text-gray-800">发现紧急缺陷，需立即处理</p>
                                <p class="text-xs text-gray-500">5分钟前</p>
                            </div>
                        </div>
                        <div class="flex items-start space-x-3">
                            <div class="w-2 h-2 bg-green-500 rounded-full mt-2"></div>
                            <div>
                                <p class="text-sm text-gray-800">消缺任务T-456已完成</p>
                                <p class="text-xs text-gray-500">10分钟前</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 待办事项 -->
                <div class="bg-white p-6 rounded-lg shadow">
                    <h3 class="text-lg font-semibold mb-4">待办事项</h3>
                    <div class="space-y-3">
                        <div class="flex items-center justify-between p-3 bg-yellow-50 rounded-lg">
                            <div class="flex items-center space-x-3">
                                <i class="fas fa-exclamation-circle text-yellow-500"></i>
                                <span class="text-sm">线路B-003缺陷复查</span>
                            </div>
                            <span class="text-xs text-gray-500">今天</span>
                        </div>
                        <div class="flex items-center justify-between p-3 bg-blue-50 rounded-lg">
                            <div class="flex items-center space-x-3">
                                <i class="fas fa-clipboard text-blue-500"></i>
                                <span class="text-sm">月度巡检计划制定</span>
                            </div>
                            <span class="text-xs text-gray-500">明天</span>
                        </div>
                        <div class="flex items-center justify-between p-3 bg-green-50 rounded-lg">
                            <div class="flex items-center space-x-3">
                                <i class="fas fa-chart-line text-green-500"></i>
                                <span class="text-sm">月度报表生成</span>
                            </div>
                            <span class="text-xs text-gray-500">本周</span>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <script>
        // 巡检进度图表
        const ctx1 = document.getElementById('inspectionChart').getContext('2d');
        new Chart(ctx1, {
            type: 'line',
            data: {
                labels: ['1日', '5日', '10日', '15日', '20日', '25日', '30日'],
                datasets: [{
                    label: '巡检完成数',
                    data: [12, 19, 23, 25, 28, 32, 35],
                    borderColor: 'rgb(59, 130, 246)',
                    backgroundColor: 'rgba(59, 130, 246, 0.1)',
                    tension: 0.4
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        display: false
                    }
                }
            }
        });

        // 缺陷分布图表
        const ctx2 = document.getElementById('defectChart').getContext('2d');
        new Chart(ctx2, {
            type: 'doughnut',
            data: {
                labels: ['一般', '严重', '紧急'],
                datasets: [{
                    data: [45, 30, 25],
                    backgroundColor: [
                        '#10B981',
                        '#F59E0B',
                        '#EF4444'
                    ]
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'bottom'
                    }
                }
            }
        });
    </script>
</body>
</html>